package com.nts.visionworks.core.security.domain;

// Generated 2013. 6. 23 ���� 6:33:40 by Hibernate Tools 4.0.0

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.ManyToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Max;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;

import org.hibernate.validator.constraints.Email;

/**
 * ManagementMember generated by hbm2java
 */
@Entity
@Table(name = "management_member", catalog = "visionworks")
public class ManagementMember implements java.io.Serializable
{

	private Integer memberId;
	private String userName;
	private String email;
	private String class_;
	private String phoneNo;
	private String cellNo;
	private Date createdDateTime;
	private Long creatorId;
	private Date updatedDateTime;
	private Set<ManagementDepartment> managementDepartments = new HashSet<ManagementDepartment>(
			0);
	private Set<SecurityIdentity> securityIdentities = new HashSet<SecurityIdentity>(
			0);

	public ManagementMember()
	{
	}

	public ManagementMember(String userName, String email)
	{
		this.userName = userName;
		this.email = email;
	}

	public ManagementMember(String userName, String email, String class_,
			String phoneNo, String cellNo, Date createdDateTime,
			Long creatorId, Date updatedDateTime,
			Set<ManagementDepartment> managementDepartments,
			Set<SecurityIdentity> securityIdentities)
	{
		this.userName = userName;
		this.email = email;
		this.class_ = class_;
		this.phoneNo = phoneNo;
		this.cellNo = cellNo;
		this.createdDateTime = createdDateTime;
		this.creatorId = creatorId;
		this.updatedDateTime = updatedDateTime;
		this.managementDepartments = managementDepartments;
		this.securityIdentities = securityIdentities;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "MemberId", unique = true, nullable = false)
	public Integer getMemberId()
	{
		return this.memberId;
	}

	public void setMemberId(Integer memberId)
	{
		this.memberId = memberId;
	}

	@NotNull(message = "validation.managementMember.userName.notNull")
	@Size(message = "validation.managementMember.userName.length", max = 20, min = 1)
	@Column(name = "UserName", nullable = false, length = 20)
	public String getUserName()
	{
		return this.userName;
	}

	public void setUserName(String userName)
	{
		this.userName = userName;
	}

	@NotNull(message = "validation.managementMember.email.notNull")
	@Max(message = "validation.managementMember.email.max", value = 50)
	@Pattern(message = "validation.managementMember.email.pattern", regexp = "(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])")
	@Column(name = "Email", nullable = false, length = 50)
	public String getEmail()
	{
		return this.email;
	}

	public void setEmail(String email)
	{
		this.email = email;
	}

	@Column(name = "Class", length = 20)
	public String getClass_()
	{
		return this.class_;
	}

	public void setClass_(String class_)
	{
		this.class_ = class_;
	}

	@Max(message = "validation.managementMember.phoneNo.max", value = 20)
	@Column(name = "PhoneNo", length = 20)
	public String getPhoneNo()
	{
		return this.phoneNo;
	}

	public void setPhoneNo(String phoneNo)
	{
		this.phoneNo = phoneNo;
	}

	@Max(message = "validation.managementMember.cellNo.max", value = 20)
	@Column(name = "CellNo", length = 20)
	public String getCellNo()
	{
		return this.cellNo;
	}

	public void setCellNo(String cellNo)
	{
		this.cellNo = cellNo;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "CreatedDateTime", length = 19)
	public Date getCreatedDateTime()
	{
		return this.createdDateTime;
	}

	public void setCreatedDateTime(Date createdDateTime)
	{
		this.createdDateTime = createdDateTime;
	}

	@Column(name = "CreatorId")
	public Long getCreatorId()
	{
		return this.creatorId;
	}

	public void setCreatorId(Long creatorId)
	{
		this.creatorId = creatorId;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "UpdatedDateTime", length = 19)
	public Date getUpdatedDateTime()
	{
		return this.updatedDateTime;
	}

	public void setUpdatedDateTime(Date updatedDateTime)
	{
		this.updatedDateTime = updatedDateTime;
	}

	@ManyToMany(fetch = FetchType.LAZY, mappedBy = "managementMembers")
	public Set<ManagementDepartment> getManagementDepartments()
	{
		return this.managementDepartments;
	}

	public void setManagementDepartments(
			Set<ManagementDepartment> managementDepartments)
	{
		this.managementDepartments = managementDepartments;
	}

	@ManyToMany(fetch = FetchType.LAZY, mappedBy = "managementMembers")
	public Set<SecurityIdentity> getSecurityIdentities()
	{
		return this.securityIdentities;
	}

	public void setSecurityIdentities(Set<SecurityIdentity> securityIdentities)
	{
		this.securityIdentities = securityIdentities;
	}

}
